package com.wen.controller;

import com.wen.common.R;
import com.wen.pojo.dto.PurchaseOrderDetailsDto;
import com.wen.pojo.dto.PurchaseOrderDto;
import com.wen.service.PurchaseOrderDetailsService;
import com.wen.service.PurchaseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/purchaseOrderDetails")
public class PurchaseOrderDetailsController {
    @Autowired
    private PurchaseOrderDetailsService service;

    @GetMapping("purchases/{id}")
    public R PurById(@RequestBody @PathVariable String id){
        List<PurchaseOrderDetailsDto> purchaseOrderDetails = service.SelAllId(id);
        return R.ok().data("purchaseOrderDetails",purchaseOrderDetails);

    }
}
